import React from "react";
import { browserHistory } from "react-router";
import { Menu, Icon } from 'antd';
import Nav from "../../container/home/NavCtr";
import Header from "../../container/home/HeaderCtr";
import User from "../../component/home/User.jsx";

class Dashboard extends React.Component {

    componentWillMount() {
        const {setPage} = this.props;
        typeof(setPage) == "function" && setPage([{
            title: "车联网平台首页",
            url: "/dashboard"
        }], "车联网平台首页")
    }

    render() {
        const pathName = this.props.location.pathname;

        return <div data-page="dashboard">
                   <div className="l-bar">
                       <div className="l-h" onClick={ () => browserHistory.push("/dashboard") }>
                           <div className="g-logo"></div>
                       </div>
                       <div className="l-nav">
                           <Nav pathName={ pathName } />
                           <User />
                       </div>
                   </div>
                   <Header />
                   <div className="r-page">
                       { this.props.children }
                   </div>
               </div>
    }
}

export default Dashboard;